export function searchApi(param?: string) {
  return new Promise<string[]>((resolve, reject) => {
    const p = (param || '').split('')
    const arr: string[] = []
    for(var i = 0; i < 10000; i++) {
      const pindex = i % p.length
      arr.push(`${p[pindex] || '^ ^'} - ${Math.random()}`)
    }
    
    if (Math.random() * 10 > 1) {
      resolve(arr)
    } else {
      reject('请求异常，请重新尝试！')
    }
  })
}

export function createList(param?: string) {
  const p = (param || '').split('')
  const arr: string[] = []
  for(var i = 0; i < 10000; i++) {
    const pindex = i % p.length
    arr.push(`${p[pindex] || '^ ^'} - ${Math.random()}`)
  }

  return arr
}